-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return task ARN from the handle command #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Do we need to deploy it before it could be directly used?
@@ -207,4 +209,8 @@ def run_task(self, config, task_def_arn, security_group_id, subnet_id, cmd): | |||
# | |||
# See: https://docs.aws.amazon.com/AmazonECS/latest/userguide/ecs-account-settings.html#ecs-resource-ids # NOQA | |||
task_id = task["taskArn"].split("/")[-1] | |||
return task_id | |||
|
|||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a nitpick. It seems like task_id
is read from task["taskArn"]
anyway, so it might work if we just return task["taskArn"]
and read the task_id
in the calling spot of this run_task
method. Functionality-wise, this makes no difference. So this change is optional and up to you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
da01c53
to
201c7fd
Compare
When running ecsmanage in a programmatic setting, it is useful to get the ARN of the task which it started, in addition to the URL being printed to the console. This doesn't break existing workflows, but adds the possibility of new ones.
201c7fd
to
aff275b
Compare
Yes. I'll do a major version upgrade since this changes the API by returning a value where previously nothing was returned. |
Thanks for reviewing and the great code suggestion! |
Overview
When running ecsmanage in a programmatic setting, it is useful to get the ARN of the task which it started, in addition to the URL being printed to the console. This doesn't break existing workflows, but adds the possibility of new ones.
Demo
Notes
This does add an addition line in the command output:
but that shouldn't affect any real world usage.
Testing Instructions
ecsmanage
from this branch:./scripts/update && ./scripts/server